<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglib.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<x:multiLanguage>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Form Editor</title>
<!-- form editor -->
<script type="text/javascript" src='<s:url value="/core/form/webeditor/fckeditor.js" />'></script>
<script type="text/javascript" src='<s:url value="/script/jquery/plugins/jquery.json-2.2.js" />'></script>
<script type="text/javascript">
	function callback(obj){
		$('input,select,textarea')
		.each(function() {
			var id = $(this).attr('id');
			if (obj[id]) {
				$(this).val(obj[id]);
			}
		});
	}
</script>
</head>
<body>
<div class="pageContent">
<s:form name="form" action="save" theme="simple" cssClass="pageForm" onsubmit="return validateCallback(this, callback)">
	<!-- 表单操作条 -->
	<div class="formBar">
		<ul>
			<li>
				<div class="buttonActive">
					<div class="buttonContent"><button type="submit">保存</button></div>
				</div>
			</li>
			<li>
				<div class="button">
					<div class="buttonContent"><button type="button" class="close">返回</button></div>
				</div>
			</li>
		</ul>
	</div>
	
	<div class="pageFormContent">
		<!-- 两个属性暂时保留，删除影响其他控件加载 -->
		<s:hidden name="moduleid" id="moduleid"/>
		<s:hidden name="applicationid" id="application"/>
		<s:hidden name="content.created" id="created"/>
		
		<p>
			<label>ID:</label>
			<s:textfield name="content.id" id="id"/>
		</p>
		
		<p>
			<label>Name: </label>
			<s:textfield name="content.name" id="name"/>
		</p>
	</div>
	
	<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" align="center">
		<tr valign="top">
			<td height="100%">
			<div id="form_editor" style="height: 100%;width: 100%;oveflow: hidden;">
				<div id="eWebEditor">
					<s:textarea cssStyle="display:none" name="content.templatecontext" id="templatecontext"></s:textarea>
					<script type="text/javascript">
						var sBasePath = '<s:url value="/core/form/webeditor"/>';
						var oFCKeditor = new FCKeditor("content.templatecontext");
						//oFCKeditor.ToolbarSet = "myeditor";
						oFCKeditor.BasePath	= sBasePath;
						oFCKeditor.Height	= "400px";
						oFCKeditor.ReplaceTextarea();
					</script>
				</div>
			</div>
			</td>
		</tr>
	</table>
</s:form>
</div>
</body>
</x:multiLanguage>
</html>